import Relay from "react-relay";

export default class GetGoodsListMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { getGoodsList }`;
    }

    getVariables() {
        return {
            argsInput: {
                companyId: this.props.companyId,
                categoryId:this.props.categoryId
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on getGoodsListPayload {
            responseData {
                errorCode
                value
                totalResult
                id
                goodsInfoDescModelList{
                    fabricWeave
                    networkType
                    weftYarn
                    weavingProcess
                    season
                    carding
                    constituent
                    high
                    productName
                    pattern
                    description
                    goodsId
                    purpose
                    thickness
                    yarnState
                    categoryId
                    status
                    yarn
                    gramWeight
                    larghezza
                    size
                    companyId
                    colour
                    prickle
                    yarnTypes
                    styleNo
                    specification
                    density
                    ranzhengProcess
                    isImport
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
              fragment on getGoodsListPayload {
                    responseData {
                        errorCode
                        value
                        totalResult
                        id
                        goodsInfoDescModelList{
                           fabricWeave
                            networkType
                            weftYarn
                            weavingProcess
                            season
                            carding
                            constituent
                            high
                            productName
                            pattern
                            description
                            goodsId
                            purpose
                            thickness
                            yarnState
                            categoryId
                            status
                            yarn
                            gramWeight
                            larghezza
                            size
                            companyId
                            colour
                            prickle
                            yarnTypes
                            styleNo
                            specification
                            density
                            ranzhengProcess
                            isImport
                        }
                    }
                }
            `]
        }];
    }

}

